import themeMixin from '../../behaviors/theme'

Page({
  behaviors: [themeMixin],
  data: {
    openMenu: false,
    openMenu2: false,
    openMenu3: false,
    openMenu4: false,
    auth: true,
    searchInputFocus: false,
    messages: [
      {
        id: 1,
        primary: 'Brunch this week?',
        secondary: "I'll be in the neighbourhood this week. Let's grab a bite to eat",
        person: 'https://material-ui.com/static/images/avatar/5.jpg',
      },
      {
        id: 2,
        primary: 'Birthday Gift',
        secondary: `Do you have a suggestion for a good present for John on his work
          anniversary. I am really confused & would love your thoughts on it.`,
        person: 'https://material-ui.com/static/images/avatar/1.jpg',
      },
      {
        id: 3,
        primary: 'Recipe to try',
        secondary: 'I am try out this new BBQ recipe, I think this might be amazing',
        person: 'https://material-ui.com/static/images/avatar/2.jpg',
      },
      {
        id: 4,
        primary: 'Yes!',
        secondary: 'I have the tickets to the ReactConf for this year.',
        person: 'https://material-ui.com/static/images/avatar/3.jpg',
      },
      {
        id: 5,
        primary: "Doctor's Appointment",
        secondary: 'My appointment for the doctor was rescheduled for next Saturday.',
        person: 'https://material-ui.com/static/images/avatar/4.jpg',
      },
      {
        id: 6,
        primary: 'Discussion',
        secondary: `Menus that are generated by the bottom app bar (such as a bottom
          navigation drawer or overflow menu) open as bottom sheets at a higher elevation
          than the bar.`,
        person: 'https://material-ui.com/static/images/avatar/5.jpg',
      },
      {
        id: 7,
        primary: 'Summer BBQ',
        secondary: `Who wants to have a cookout this weekend? I just got some furniture
          for my backyard and would love to fire up the grill.`,
        person: 'https://material-ui.com/static/images/avatar/1.jpg',
      },
    ],
  },
  onLoad() {
    this.setData({
      CloseMenu: this.CloseMenu.bind(this),
      CloseMenu2: this.CloseMenu2.bind(this),
      CloseMenu3: this.CloseMenu3.bind(this),
      CloseMenu4: this.CloseMenu4.bind(this),
      changeAuth: this.changeAuth.bind(this),
      inputFocusOrBlur: this.inputFocusOrBlur.bind(this),
    })
  },
  OpenMenu() {
    this.setData({openMenu: true})
  },
  CloseMenu() {
    this.setData({openMenu: false})
  },
  OpenMenu2() {
    this.setData({openMenu2: true})
  },
  CloseMenu2() {
    this.setData({openMenu2: false})
  },
  OpenMenu3() {
    this.setData({openMenu3: true})
  },
  CloseMenu3() {
    this.setData({openMenu3: false})
  },
  OpenMenu4() {
    this.setData({openMenu4: true})
  },
  CloseMenu4() {
    this.setData({openMenu4: false})
  },
  changeAuth() {
    this.setData({auth: !this.data.auth})
  },
  inputFocusOrBlur(e) {
    if (e.type === 'focus') {
      this.setData({searchInputFocus: true})
    } else if (e.type === 'blur') {
      this.setData({searchInputFocus: false})
    }
  },
})
